package com.wbs.controller;

import com.wbs.resutil.Result;
import com.wbs.service.ContentService;
import com.wbs.vo.ContentVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: 芝梦
 * @Description: 广告信息控制层
 * @DateTime: 2024/2/1 8:23
 */
@RequestMapping("content")
@RestController
public class ContentController {
    @Autowired
    private ContentService contentService;

    @Autowired
    private RedisTemplate redisTemplate;
    @GetMapping("selectByCategoryId")
    public Result selectByCategoryId(@RequestParam Long categoryId){
    List<ContentVO> contentVOList = contentService.selectByCategoryId(categoryId);
        return Result.SUCCESS().setData(contentVOList);
    }

}
